<%@ page import="databeans.*"%>
<%@ page import="java.util.*" %>
<%@ page import="helper.*"%>
<jsp:include page="../common/header.jsp" />

<title>Carnegie Financial Services - View Payment History</title>
<script type="text/javascript">
	$(document).ready(function() { 
		
		$('#trans-history').colorize({ hoverColor:'none', ignoreHeaders :true, hiliteColor :'none' });

	});
</script>
</head>

<body>
	<div id="container">
    	<div id="header">
        	<h2>Carnegie Financial Services</h2>
    		<jsp:include page="../common/top-menu.jsp" />
    		<div id="top-panel">
	            <div id="panel">
	                <ul>
	                    <li><a href="customerViewTransactionHistory.do" class="invoices">View Share Transactions</a></li>
	                    <li><a href="customerViewPaymentHistory.do" class="invoices current" >View Check Transactions</a></li>
	                   <!-- <li><a href="#" class="useredit" id="">View Pending Transactions</a></li>  --> 
	                </ul>
	            </div>
	      	</div>
    		
      </div>
        <div id="wrapper">
            <div id="content">
            	<div id="box">
	            	<h3>Transaction History</h3>
	            	<jsp:include page="../common/messages.jsp"/>
	            	<% 
	            		ArrayList<Integer> transIDs = (ArrayList<Integer>)request.getAttribute("transIDs");
						ArrayList<String> transDates = (ArrayList<String>)request.getAttribute("transDates");
						ArrayList<String> transTypes = (ArrayList<String>)request.getAttribute("transTypes"); 
						ArrayList<Long> amounts = (ArrayList<Long>)request.getAttribute("amounts");
						ArrayList<String> statuses = (ArrayList<String>)request.getAttribute("statuses"); 
						if (transTypes.size()==0){
					  %>
					  <p>You have no payment transaction so far.</p> 
					 <% 
						 }else{
					 %>
	            	<div class="trans-history">
                		<table id="trans-history">
                			<thead>
								<tr>
									<th>ID</th>
	                            	<th>Date</th>
	                                <th>Type</th>
	                                <th>$ Amount</th>
	                                <th>Status</th>
	                            </tr>
							</thead>
							<tbody>
							<%for(int i=0; i<transDates.size(); i++){ %>
								<tr>
									<td style="text-align:center;"><%=transIDs.get(i) %></td>
									<td style="text-align:center;"><%=transDates.get(i).toString()%></td>
									<td style="text-align:left;"><%=transTypes.get(i) %></td>
									<td style="text-align:right;padding-right:10px;">$<%=helper.Formatter.prepCashToView(amounts.get(i)) %></td>
									<td style="text-align:center;">
										<%if(statuses.get(i).equals("Pending")) { %>
											<span class="pending pad-left-20">Pending</span>
										<%}else if(statuses.get(i).equals("Approved")){ %>
											<span class="tick pad-left-20">Approved</span>
										<%} %>
									</td>
								</tr>
							<% } %>
							</tbody>
						</table>
                	</div>
                	<!-- 
                	<div class="navigation_pages">
						<a href="#">Next</a>
						<a href="#">Last</a>
					</div>
					 -->
                	<% } %>
	            </div>
            </div>
            
            <jsp:include page="../common/sidebar.jsp" />
      </div>
        <jsp:include page="../common/footer.jsp" />
</div>
</body>
</html>

